#include <stdio.h>
#include <string.h>
#include <assert.h>
//char* strcat(char* destination, const char* source)-字符串追加
//注意事项与strcpy相似

char* my_strcat(char* dest, const char* src)
{
    assert(dest && src);
    char* ret = dest;
    while(*dest)
    {
        dest++;
    }
    while(*dest++ = *src++);
    return ret;
}

int main()
{
    char arr1[20] = "hello ";
    strcat(arr1, "world!");
    my_strcat(arr1, "haha!");
    printf("%s\n", arr1);
    return 0;
}